home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
pcl4c34.zip
/
PCL4C.REF
< prev
next >
Wrap
Text File
|
1993-01-01
|
61KB
|
2,283 lines
Personal Communications Library
For the C Language
(PCL4C)
REFERENCE MANUAL
Version 3.4
Jan 4, 1993
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 1993
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815
Voice 205-881-4630
FAX 205-881-4630
BBS 205-880-9748
PCL4C Reference Manual Page 1
C O N T E N T S
Chapter Page
Table of Contents.............................2
Introduction..................................3
SioBaud....................................4
SioBrkKey..................................5
SioBrkSig..................................6
SioCrtWrite................................7
SioCTS.....................................8
SioDCD.....................................9
SioDelay..................................10
SioDone...................................11
SioDSR....................................12
SioDTR....................................13
SioError..................................14
SioFIFO...................................15
SioFlow...................................16
SioGetc...................................17
SioKeyPress...............................18
SioKeyRead................................19
SioInfo...................................20
SioIRQ....................................21
SioLine...................................22
SioLoopBack...............................23
SioModem..................................24
SioParms..................................25
SioPutc...................................26
SioRead...................................27
SioReset..................................28
SioRI.....................................29
SioRTS....................................30
SioRxBuf..................................31
SioRxFlush................................32
SioRxQue..................................33
SioTimer..................................34
SioUART...................................35
SioUnGetc.................................36
Function Summary.............................37
Error Code Summary...........................38
PCL4C Reference Manual Page 2
Introduction
This manual lists all of the PCL4C functions in alphabetical
order. Every library function will return a value as follows:
1. Negative values for error conditions. See last page of this
manual for a list of error values and their meanings.
2. Non-negative values when returning data (eg: SioLine).
3. Zero otherwise.
When debugging an application, be sure to test all return values.
Use SioError to print the associated text for errors.
Example Code Segment
*****************************************************************
* int Code; /* MUST be 'int', not 'char' */ *
* *
* Code = SioFunction( ); /* any PCL4C function */ *
* if(Code<0) *
* {/* error returned */ *
* SioError(Code); /* SioError prints error text */ *
* SioDone(Port); /* always call SioDone last */ *
* exit(1); *
* } *
* /* no errors */ *
* ...your application code... *
* *
*****************************************************************
For more examples, examine each of the example programs provided
(SIMPLE.C and TERM.C). Also look at the examples associated with
each library function described in the following section.
Refer to the User's Manual (PCL4C.USR) for addition information.
PCL4C Reference Manual Page 3
SioBaud
Function Sets the baud rate of the selected port.
Syntax int SioBaud(Port,BaudCode)
int Port; /* Port selected (COM1 - COM4) */
int BaudCode; /* Baud code */
Remarks The SioBaud function sets the baud rate without
resetting the port. It is used to change the baud rate
after calling SioReset.
Baud Code Baud Rate PCL4C.H Name
0 300 Baud300
1 600 Baud600
2 1200 Baud1200
3 2400 Baud2400
4 4800 Baud4800
5 9600 Baud9600
6 19200 Baud19200
7 38400 Baud38400
8 57600 Baud57600
9 115200 Baud115200
Returns -4 : Port out of range. Expected 0 to 3.
-11 : Bad baud rate code. See above code values.
Example /* do auto baud detect */
for(Code=0;Code<10;Code++)
{/* set baud rate & transmit 'A' */
SioBaud(Port,Code);
SioPutc(Port,'A');
/* assume other side echos back */
if(SioGetc(Port,18)=='A'))
{puts("Baud rate detected");
/*...do something here...*/
}
}
See Also SioReset
PCL4C Reference Manual Page 4
SioBrkKey
Function Return non-zero if the Control-BREAK key was pressed.
Syntax int SioBrkKey()
Remarks The SioBrkKey function returns a TRUE value (non-
zero) if the Control-BREAK key was pressed, else it
returns a zero. Use SioBrkKey as a safety exit from a
polling loop. Don't mix this function up with